package com.xiaoxing.zhinenghuacangku_liaocheng.mvp.model;

import android.app.Application;

import com.google.gson.Gson;
import com.jess.arms.di.scope.ActivityScope;
import com.jess.arms.integration.IRepositoryManager;
import com.jess.arms.mvp.BaseModel;
import com.xiaoxing.zhinenghuacangku_liaocheng.mvp.model.service.ZhiNengCangKuService;
import com.xiaoxing.zhinenghuacangku_liaocheng.mvp.ui.entity.RuKuQingZhang;
import com.xiaoxing.zhinenghuacangku_liaocheng.mvp.contract.LiaoCheng_RuKuQingZhangContract;

import java.util.Map;

import javax.inject.Inject;

import io.reactivex.Observable;


@ActivityScope
public class LiaoCheng_RuKuQingZhangModel extends BaseModel implements LiaoCheng_RuKuQingZhangContract.Model {
    @Inject
    Gson mGson;
    @Inject
    Application mApplication;

    @Inject
    public LiaoCheng_RuKuQingZhangModel(IRepositoryManager repositoryManager) {
        super(repositoryManager);
    }

    @Override
    public Observable<RuKuQingZhang> getRuKuQingZhangData(Map<String, String> map) {
        return mRepositoryManager.obtainRetrofitService(ZhiNengCangKuService.class).getRuKuQingZhangData(map);

    }

    @Override
    public Observable<String> callAgvGetMaterialToInstoreBuffer(String mid) {
        return mRepositoryManager.obtainRetrofitService(ZhiNengCangKuService.class).callAgvGetMaterialToInstoreBuffer(mid);

    }

    @Override
    public Observable<String> checkCanReInstore(String mid) {
        return mRepositoryManager.obtainRetrofitService(ZhiNengCangKuService.class).checkCanReInstore(mid);

    }

    @Override
    public Observable<String> instoreAgain(String mid) {
        return mRepositoryManager.obtainRetrofitService(ZhiNengCangKuService.class).instoreAgain(mid);

    }

    @Override
    public Observable<String> getUserSpaceListForAutoStore(String user_id, String spname) {
        return mRepositoryManager.obtainRetrofitService(ZhiNengCangKuService.class).getUserSpaceListForAutoStore(user_id, spname);

    }

    @Override
    public Observable<String> addAgvTask(String mid, String instoreBufferId, String spid, String num, String uid, String remark) {
        return mRepositoryManager.obtainRetrofitService(ZhiNengCangKuService.class).addAgvTask(mid, instoreBufferId, spid, num, uid, remark);
    }

    @Override
    public Observable<String> setInstoreBufferReadyForAGV(String bufferId, String spid) {
        return mRepositoryManager.obtainRetrofitService(ZhiNengCangKuService.class).setInstoreBufferReadyForAGV(bufferId, spid);

    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        this.mGson = null;
        this.mApplication = null;
    }
}